1. Field of the Invention
The present invention relates to a technology for transferring packets received via a network to a host computer.
2. Description of the Related Art
How to reduce load increasingly put on a host computer for conducting communication with the improvement in speed of networks is a recent problem. Particularly, in the combination of a widely used transmission control protocol (TCP)/internet protocol (IP) and a socket application interface (socket API), the reduction of the load of a host computer, put on its protocol processing for each packet and memory-to-memory copy is currently a problem.
Every time a packet is transmitted/received, processes, such as the generation and analysis of a header and the like are performed. In order to further improve communication speed, it is preferable to increase the size of each packet to be transmitted as much as possible to shorten time needed for these processes. However, in a network, such as Ethernet (trademark) or the like, the maximum length (maximum transmit unit (MTU)) of each packet is specified. For example, generally it is 1,500 bytes in normal Ethernet, and approximately nine kilobytes even if an extension function called “jumbo frame” is used. In a recent high-speed network, particularly there is a possibility that a protocol processing for each packet may become a bottleneck.
As a technology for reducing the load of the processing for each packet, for example, a technology for grouping packet information about a header and the like when receiving a packet from a communication network to reduce the load put on the CPU of a host computer is disclosed (for example, Patent reference 1). For another example, a technology for extracting a plurality of packets sharing a route from their destination addresses, grouping a plurality of such packets and transmitting a grouped packet containing information about each packet is also disclosed (for example, Patent reference 2). Furthermore, for another example, a technology for dividing a packet at a TCP level on the transmitting side and combining the divided packets is also disclosed (for example, Patent reference 3).
As another technology for improving communication speed, there is a technology for shortening the time needed for memory-to-memory copy, of a host computer disclosed in the International Application No. PCTJP04/12006. According to such a technology, on the transmitting side of a packet, direct memory access (DMA) transfer is applied to the data section of the packet and the data section is transferred from the user space to the buffer (transmitting buffer) of a network adapter. Data stored in the buffer of the network adapter is transmitted to the network, using the generated header. In a network adapter on the packet receiving side, when transferring the packet received from the network to the host computer, the header and the data section are separated, and firstly the generated header is transferred to the host computer. The software of the host computer applies a protocol processing to the header section, and after the user space of a data destination is determined, the data section is transferred.
Patent reference 1: Japanese Patent Application No. 2003-87255 (Abstract, FIGS. 1 and 2 and paragraph 0035)
Patent reference 2: Japanese Patent Application No. 2003-003673 (Abstract and claim 1)
Patent reference 3: Japanese Patent Application No. 2002-84289 (Abstract, FIG. 1 and paragraph 0008)
It is difficult to receive each packet in such a way that each packet can be stored in the memory of its own device as one continuous packet when the network adapter receives packets to be transferred to the host computer, from the network. Specifically, it is difficult to implement immediate disassembly of the packet arriving from the network and storing the data section in an appropriate position after determining in what part of the entire packet the data section is located, as the memory-to-memory copy causes overhead. In this case, discontinuous packets are transmitted to the memory of the network adapter and are transferred to the memory of the host computer in such way as to form one continuous area. Since such a technology is a general technology called “scatter gather DMA”, its description is omitted here.
The transfer to the host computer of the data section stored in the network adapter is instructed by the host computer. In order to realize this, the host computer must recognize where in the memory of the network adapter each data section exists. In order for the host computer to realize the transfer process without recognizing the location of the data section, a handle must be issued to a packet composed of the data section in the network adapter and the correspondence between this handle and each data section must be managed in the network adapter. This incurs a management cost on the network adapter side.
Alternatively, when transferring the data section of the packet discontinuously stored in the memory of the network adapter to the host computer, information about a leading address and length of each stored data section must be notified from the network adapter to the host computer. In a conventional DMA transfer, such information is notified to the host computer together with DMA descriptor. However, since the length of the DMA descriptor is fixed, the larger the amount of data of a received packet, the greater the number of sets of the leading address and data length. For example, if packets received from the 1,500-byte MTU Ethernet are grouped every 64 kilobytes, the number of sets of the leading address and data length becomes 44. An area for storing such much information must be allocated for one DMA descriptor.